package com.example.jiankang.Fragment;

import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ListView;
import androidx.fragment.app.Fragment;
import com.example.jiankang.R;
import com.example.jiankang.adapter.jiankangAdapter;
import com.example.jiankang.entity.Jiankang;
import java.util.ArrayList;
import java.util.List;
import com.example.jiankang.R;

public class ShouyeFragment extends Fragment {
    private List<Jiankang> datalist = new ArrayList<>();

    public View onCreateView(LayoutInflater inflater, ViewGroup container,Bundle savedInstanceState) {
        View view = inflater.inflate(R.layout.fragment_shouye, container, false);
        ListView listView = view.findViewById(R.id.list_view);

        datalist.add(new Jiankang("饮食养生", "春季宜食辛甘发散之品"));
        datalist.add(new Jiankang("运动建议", "每日晨练30分钟"));
        datalist.add(new Jiankang("足三里", "每日按摩5分钟，增强免疫力"));
        datalist.add(new Jiankang("夏季情绪", "静心养神，忌大喜大悲"));

        jiankangAdapter adapter = new jiankangAdapter(getActivity(),R.layout.list_view,datalist);
        listView.setAdapter(adapter);
        return view;
    }
}